<?php

include_once 'connection/connection_database.php';

class Categories {

    function FillAll() {
        $sql = "SELECT * FROM category WHERE category_status = 1 ORDER BY category_order ASC";
        $result = mysql_query($sql) or die(mysql_error());
        return $result;
    }

    function FillLimit() {
        $sql = "SELECT * FROM category WHERE category_status = 1 ORDER BY category_order ASC LIMIT 4";
        $result = mysql_query($sql) or die(mysql_error());
        return $result;
    }
    
    function FillOne($category) {
        $sql = "SELECT * FROM category WHERE category_id='{$category["id"]}'";
        $result = mysql_query($sql) or die(mysql_error());
        return mysql_fetch_array($result);
    }
    
    function FillByLink($category) {
        $sql = "SELECT * FROM category WHERE category_url='{$category}'";
        $result = mysql_query($sql) or die(mysql_error());
        return $result;
    }

}

?>
